//百度地图分辨率 resolutions
const bMapResolutions = function () {
  var resolutions = [];
  var maxZoom = 18;
  for (var i = 0; i <= maxZoom; i++) {
    resolutions[i] = Math.pow(2, maxZoom - i);
  }
  return resolutions;
};

// baiduMap 百度地图瓦片解析配置
export const haidianBaiduMapConfig = {
  defaultJd: '116.40', //默认经度
  defaultWd: '39.91', //默认纬度
  defaultZoom: 9, //地图默认显示层级
  minZoom: 6, //最层级
  maxZoom: 18, //最小层级
  projection: 'EPSG:4326',
  tileGrid: {
    origin: [0, 0],
    resolutions: bMapResolutions(),
  },
  tileUrlFunction: function (tileCoord) {
    var z = tileCoord[0];
    var x = tileCoord[1];
    var y = tileCoord[2];
    return 'http://14.120.5.222:8219/tile?x=' + x + '&y=' + y + '&z=' + z;
  },
};
